﻿// Fill out your copyright notice in the Description page of Project Settings.


#include "Input/StarrySkyInputConfig.h"

const UInputAction* UStarrySkyInputConfig::FindAbilityInputActionForTag(const FGameplayTag& InputTag,
	bool bLogNotFound) const
{
	//FAuraInputAction&使用引用，不会复制
	//循环列表比对游戏标签让后返回对应输入动作
	for (const FStarrySkyInputAction& StarrySkyInputAction : AbilityInputActions)
	{
		if(StarrySkyInputAction.InputAction && StarrySkyInputAction.InputTag.MatchesTagExact(InputTag))
		{
			return StarrySkyInputAction.InputAction;
		}
	}

	if (bLogNotFound)
	{
		UE_LOG(LogTemp, Error, TEXT("Can't find Ability Input Action for Tag [%s] on [%s]."), *InputTag.ToString(), *GetNameSafe(this));
	}

	return nullptr;
}
